package me.zhao.factory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * properties文件操作
 */
public class PropertiesUtil {
	public Map<String,String> getProperties(){
		Properties properties = new Properties();
		Map<String,String> typeMap = new HashMap<String,String>();
		InputStream is = getClass().getResourceAsStream("hairType.properties");
		try {
			properties.load(is);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		Enumeration en = properties.propertyNames();
		while(en.hasMoreElements()){
			String key = (String) en.nextElement();
			String prop = properties.getProperty(key);
			typeMap.put(key, prop);
		}
		return typeMap;
	}
}
